﻿<phone:PhoneApplicationPage 
    x:Class="ARFinity.ARMapView"    
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
	xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:Microsoft_Phone_Controls_Maps="clr-namespace:Microsoft.Phone.Controls.Maps;assembly=Microsoft.Phone.Controls.Maps"   
    
	mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="696"	
	FontFamily="{StaticResource PhoneFontFamilyNormal}"
	FontSize="{StaticResource PhoneFontSizeNormal}"
	Foreground="{StaticResource PhoneForegroundBrush}"
	Orientation="Portrait" shell:SystemTray.IsVisible="True"     
    >
    <phone:PhoneApplicationPage.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/ARFinity;component/Dictionary.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </phone:PhoneApplicationPage.Resources>

    <Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>        

        <Grid x:Name="ContentPanel" Grid.Row="1" >
            <Grid.RowDefinitions>
                <RowDefinition Height="1*" />
                <RowDefinition Height="20*" />
            </Grid.RowDefinitions>
            <Microsoft_Phone_Controls_Maps:Map Height="800" Width="800" Margin="-400" Grid.RowSpan="2"
                x:Name="myMap" CredentialsProvider="{Binding BingMapCredentials}"
                ZoomLevel="{Binding Zoom, Mode=TwoWay}" ZoomBarVisibility="Collapsed" 
                MouseMove="myMap_MouseMove" RenderTransformOrigin="0.5, 0.5"
                >
                <Microsoft_Phone_Controls_Maps:Map.RenderTransform>
                    <CompositeTransform CenterX="0.5" CenterY="0.5" />
                </Microsoft_Phone_Controls_Maps:Map.RenderTransform>
                <Microsoft_Phone_Controls_Maps:Pushpin Canvas.ZIndex="99" Location="{Binding Center}" Background="Transparent" Visibility="{Binding OnFreeFollowMode, Converter={StaticResource BooleanToVisibilityConverter1}}">
                    <Grid RenderTransformOrigin="0.5, 0.5" x:Name="myPointerGrid" MinWidth="400" MinHeight="400" Margin="-200">
                        <Grid.RenderTransform>
                            <CompositeTransform CenterX="0.5" CenterY="0.5" />
                        </Grid.RenderTransform>
                        <Ellipse Grid.RowSpan="2" Stroke="Blue" Fill="#1F0000FF"
                            VerticalAlignment="Center" HorizontalAlignment="Center" Width="{Binding AccuracyDiameter, Mode=OneWay}" 
                            Visibility="{Binding Path=AccuracyRadiusVisible, Converter={StaticResource BooleanToVisibilityConverter1}}"
                            Height="{Binding AccuracyDiameter, Mode=OneWay}" />
                        <!--<Image Source="images\HeadingAngleMedium@2x.png" Stretch="None" Margin="0,0,0,120" Visibility="{Binding Path=HeadingVisibility, Converter={StaticResource BooleanToVisibilityConverter1}}" />-->
                        <Image Source="images\TrackingDot@2x.png" Stretch="None" />
                    </Grid>
                </Microsoft_Phone_Controls_Maps:Pushpin>
            </Microsoft_Phone_Controls_Maps:Map>

            <Grid Grid.RowSpan="2" Visibility="{Binding NotOnFreeFollowMode, Converter={StaticResource BooleanToVisibilityConverter1}}" IsHitTestVisible="False">
                <Ellipse Grid.RowSpan="2" Stroke="Blue" Fill="#1F0000FF"
                            VerticalAlignment="Center" HorizontalAlignment="Center" Width="{Binding AccuracyDiameter, Mode=OneWay}" 
                            Visibility="{Binding Path=AccuracyRadiusVisible, Converter={StaticResource BooleanToVisibilityConverter1}}"
                            Height="{Binding AccuracyDiameter, Mode=OneWay}" />
                <Image Source="images\HeadingAngleMedium@2x.png" Stretch="None" Margin="0,0,0,120" Visibility="{Binding Path=HeadingVisibility, Converter={StaticResource BooleanToVisibilityConverter1}}" />
                <Image Source="images\TrackingDot@2x.png" Stretch="None" Visibility="{Binding Path=TrackingDotVisibility, Converter={StaticResource BooleanToVisibilityConverter1}}" />
            </Grid>
        </Grid>

        <Grid x:Name="ExternalUserControlPlaceHolder" Grid.RowSpan="2" Canvas.ZIndex="999" />

        <Grid x:Name="TitlePanel" Grid.Row="0" Background="Black">
            <TextBlock x:Name="ApplicationTitle" Text="{Binding ApplicationName, Mode=OneTime}" Style="{StaticResource PhoneTextNormalStyle}"/>
        </Grid>

        <Grid Height="90" Grid.Row="1" Background="#DD300000" VerticalAlignment="Top">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="150" />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>
            <Image Source="images\perpendicular1.png" Margin="10" />
            <TextBlock Grid.Column="1" Margin="5" TextWrapping="Wrap" TextAlignment="Center">
               Please keep your phone upright to see the selected locations around you, in virtual reality!
            </TextBlock>
        </Grid>
    </Grid>

    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
            <shell:ApplicationBarIconButton x:Name="btnLockCenter" IconUri="/images/Arrow.png" Text="Position" Click="btnLockCenter_Click" />
            <shell:ApplicationBarIconButton x:Name="btnLocations" IconUri="/images/PushPin1.png" Text="Locations" Click="btnLocations_Click" />
            <shell:ApplicationBarIconButton x:Name="btnMapMode" IconUri="/images/MapMode1.png" Text="Aerial View" Click="btnMapMode_Click" />
            <!--<shell:ApplicationBarIconButton x:Name="btnCaptureImage" IconUri="/images/camera1.png" Text="Capture" Click="btnCaptureImage_Click" />-->
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>

</phone:PhoneApplicationPage>